package top.forgirl.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import top.forgirl.common.group.Delete;
import top.forgirl.common.group.Insert;
import top.forgirl.common.group.Search;

import javax.validation.constraints.Digits;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Setter
@Getter
@ToString
@ApiModel("申请记录Do")
public class ApplyDo {

    @ApiModelProperty("唯一标识")
    @NotNull(message = "id不能为空", groups = {Delete.class})
    private Integer id;

    @ApiModelProperty("开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime beginTime;

    @ApiModelProperty("结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "需求代号", required = true)
    @NotBlank(message = "需求代号不能为空", groups = {Insert.class})
    private String dId;

    @ApiModelProperty("申请人")
    @NotBlank(message = "申请人不能为空", groups = {Insert.class})
    private String name;

    @ApiModelProperty("联系电话")
    @NotBlank(message = "联系电话不能为空", groups = {Insert.class})
    private String phoneNumber;

    @ApiModelProperty(value = "公司物品代号", required = true)
    @NotBlank(message = "公司代号不能为空", groups = {Insert.class, Search.class})
    private String cId;

    @ApiModelProperty(value = "注册账号", required = true)
    @NotBlank(message = "对应的账号不能为空", groups = {Insert.class})
    public String principal;

    @ApiModelProperty("需求物品名称")
    private String dName;
}
